package com.ase.单例模式.lazy;

/**
 * 懒汉模式
 * @author gyhstart
 * @create 2021/2/15 - 14:23
 **/
public class Singleton {
    private static Singleton singleton;

    private Singleton(){}

    public static Singleton getInstance(){
        if (singleton == null){
            singleton = new Singleton();
        }
        return singleton;
    }

    public void Message(){
        System.out.println("Message" );
    }
}
